package com.panfeng.xcloud.common.core.configuration;

import com.panfeng.xcloud.common.core.component.FileUploadHandler;
import com.panfeng.xcloud.common.core.properties.FileUploadProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * 上传文件配置类
 *
 * @author xiaobo
 * @version 1.0
 * @since 2018-12-28
 */
@Configuration
@EnableConfigurationProperties({FileUploadProperties.class})
public class FileUploadConfiguration {

    @Autowired
    private FileUploadProperties fileUploadProperties;

    @Bean
    public FileUploadHandler fileUploadHandler() {
        return new FileUploadHandler(fileUploadProperties);
    }
}
